<?php
define("PROJECT", "filajs");
define("AUTHOR_NAME", "Panos Papadopoulos");
define("COPYRIGHT", "Copyright by " . AUTHOR_NAME . ". All rights reserved.");

class filajs {
	private static $server;
	private static $www;
	private static $cardFamily = "jfitz";
	private static $suitFamily = "silk";

	public static function init($server = NULL) {
		if ($server === NULL)
		switch($_SERVER["HTTP_HOST"]) {
		case "localhost":
		case "127.0.0.1":
			self::serverSet("http://" . $_SERVER["HTTP_HOST"] . "/filajs/");
			break;
		default:
			self::serverSet("http://www.filajs.net/");
			break;
		}

		else
		self::serverSet($server . "/");

		self::$www = preg_replace("/lib.filajs.php$/", "", __FILE__);
		return self::serverGet();
	}

	public static function serverSet($server) {
		self::$server = $server;
	}

	public static function serverGet() {
		return self::$server;
	}

	public static function stylesheet($css) {
		?><link rel="stylesheet" type="text/css" href="<?php
			print self::$server . $css; ?>?mt=<?php
			print filemtime(self::$www . $css); ?>" /><?php
	}

	public static function javascript($script) {
		?><script type="text/javascript" src="<?php
			print self::$server . $script; ?>?mt=<?php
			print filemtime(self::$www . $script); ?>"></script><?php
	}

	public static function cardFamilySet($family = "jfitz") {
		self::$cardFamily = $family;
	}

	public static function cardFamilyGet() {
		return self::$cardFamily;
	}

	public static function suitFamilySet($family = "silk") {
		self::$suitFamily = $family;
	}

	public static function suitFamilyGet() {
		return self::$suitFamily;
	}
}
?>
